package com.tanhua.model.vo;

import com.tanhua.model.mongo.Answer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AnswerVo {

    private String id;      // 选项编号
    private String option;      // 选项

    public static AnswerVo init(Answer answer) {
        AnswerVo vo = new AnswerVo();
        if (answer != null) {
            vo.setId(answer.getOptionId().toString());
            vo.setOption(answer.getOption());
        }
        return vo;
    }
}

